package dockyin.action.pattern.observer;

import java.util.Vector;

public abstract class AbstractSubject implements ISubject {
    private Vector<IObserver> observers = new Vector<>();

    @Override
    public void addObserver(IObserver observer) {
        observers.add(observer);
    }

    @Override
    public void delObserver(IObserver observer) {
        observers.remove(observer);
    }

    @Override
    public void notifyAllObserver() {
        observers.forEach(IObserver::update);
    }
}
